"""
执行测试用例文件
"""
import pytest
import time,os

def test_smoke():
    testcase1 = r'testcases/test_demo.py::test_reply_topic'
    testcase2 = r'testcases/test_topic.py'
    return [testcase1,testcase2]

def mul_test():
    testcase = r'testcases/test_user.py'
    return [testcase]


if __name__ == '__main__':
    reports_dir = os.path.join(os.path.dirname(__file__),'reports')
    if not os.path.exists(reports_dir):
        os.mkdir(reports_dir)
    report_file = os.path.join(reports_dir,time.strftime("%Y_%m_%d_%H_%M_%S")+".html")
    # testcases = test_smoke()
    testcases = mul_test()
    # 执行pytest方法
    pytest.main([*testcases,'-s',
                 '-v',
                 f'--html={report_file}','--self-contained-html',
                 f'--alluredir=allure-reports'])